package com.sky.demo.design_pattern.create.factory.simple_factory;

public class ChartFactory {

    public static Chart getChart(String type){
        Chart chart = null;
        if("HistogramChart".equals(type)){
            chart = new HistogramChart();
        }else if("LineChart".equals(type)){
            chart = new LineChart();
        }else if("PieChart".equals(type)){
            chart = new PieChart();
        }
        return chart;
    }
}
